const Mock = require('mockjs')
const data = Mock.mock({
    'list|15': [{
        title: '@ctitle(2,4)',
        id: '@id',
        'children|3-5': [{
            title: '@ctitle(4)',
            id: '@id',
            'children|5-15': [{
                name: '@ctitle(2,5)',
                img: '@image(50x50,@color)',
                id: '@id'
            }]
        }]
    }]
})


module.exports = {
    devServer: {
        before(app) {
            app.get('/list', (req, res) => {
                res.send(data.list)
            })
        }
    }
}